from django.test import TestCase, Client


# Create your tests here.
class RegisterTestCase(TestCase):
    def test_response(self):
        # 测试注册页面响应
        client = Client()
        response = client.get('/users/register/')
        self.assertEqual(response.status_code, 200, '状态码必须为200!')

    def test_register_an_account(self):
        # 测试注册账号功能
        client = Client()
        data = {
            'username': 'user',
            'password': '12345678',
            'password_confirm': '12345678',
        }
        response = client.post('/users/register/', data)
        self.assertEqual(response.status_code, 200, '状态码必须为200!')
